<?php
	header("Content-Type:text/html;charset=gb2312");
	$SearchInput=$_GET["SearchInput"]; 
	$SearchOption=$_GET["SearchOption"]; 
	if($SearchOption==1)
		$sql="SELECT * FROM items WHERE  ItemCode LIKE '%$SearchInput%'";
	else if($SearchOption==2)
		$sql="SELECT * FROM items WHERE  UnitPrice<'SearchInput%'";
	else if($SearchOption==3)
		$sql="SELECT * FROM items WHERE ItemDescription LIKE '%$SearchInput%'";
	else if($SearchOption==4)
		$sql="SELECT * FROM items WHERE Sailer LIKE '%$SearchInput%'";
	else if($SearchOption==5)
		$sql="SELECT * FROM items WHERE TimeRemaining='$SearchInput'";
	//echo $sql;
	$con = mysql_connect("localhost:3306","root","123");
	if ($con){
		mysql_select_db("database", $con);	
		$result=mysql_query($sql);
		echo "<table cellpadding='1' cellspacing='1' >";    
        while($rows=mysql_fetch_array($result)){
            echo "<tr width=100% style='font-size:13px' height='20px' bgcolor='#F0F0F0'>";
 				echo "<td width='70px' align='left'>&nbsp;<a href='ItemInfor.php?ItemCode=".$rows['ItemCode']."'>".$rows['ItemCode']."</a></td>" ;
				echo "<td width='270px'>&nbsp;".$rows['ItemDescription']."</td>" ;
				echo "<td width='120px' align='center'>&nbsp;".$rows['AddDate']."</td>" ;
				echo "<td width='90px' align='center'>&nbsp;".$rows['Sailer']."</td>" ;
				echo "<td width='70px' align='center'>&nbsp;".$rows['UnitPrice']."</td>" ;;
            echo "</tr>";    
         }    
        echo "</table>";  
		mysql_close($con);
	}
?>